package LineCode.剑指Offer.字符串;

public class 替换空格 {

    public static void main(String[] args) {
        StringBuffer sb = new StringBuffer("we are famliy");
        System.out.println(replaceSpace(sb));
    }


    /**
     * Java函数酷炫
     * @param str
     * @return
     */
    public static String replaceSpace(StringBuffer str) {
        return str.toString().replaceAll("\\s", "%20");
    }


}
